<?php
namespace app\api\validate\order;
use think\Validate;
class OrderValidate extends Validate
{
    protected $rule = [
        'order_id' => 'require|number',
        'product_id' => 'require',
        //'spec_sku_id' => 'require',
        'product_num' => 'require|number',
        'cart_ids' => 'require',
    ];

    protected $message = [
        'order_id.require' => '参数错误',
        'order_id.number' => '参数错误',
        'product_id.require' => '商品ID不能为空',
        //'spec_sku_id.require' => '商品规格ID不能为空',
        'product_num.require' => '商品数量不能为空',
        'product_num.number' => '商品数量格式错误',
        'cart_ids.require' => '购物车ID不能为空',
    ];
    protected $scene = [
        'buy' => ['product_id', 'product_num'],
        'cart' => ['cart_ids']
    ];
}